package com.fanqj.resilience4j.spring.controller;

import com.fanqj.resilience4j.spring.service.ITestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * resilience4j使用spring方式
 * @author <a href="mailto:fanqijin@wxchina.com">fanqj</a>
 * @Date 2021年01月27日 14:14
 * @Version 6.4.1
 */
@RestController
@RequestMapping("/spring")
public class Resilience4jWithSpringController {

    public static final Logger logger = LoggerFactory.getLogger(Resilience4jWithSpringController.class);

    @Resource(name = "TestServiceWithSpringImpl")
    private ITestService iTestService;

    @GetMapping("/test")
    public String testCircuitBreakerCustomizer() {
        return iTestService.test("CircuitBreaker with spring");
    }

}
